Optimal. Leaf size=227 \[ -\frac {B \sin (c+d x) (a \cos (c+d x))^{m+2} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+2);\frac {1}{2} (m+n+4);\cos ^2(c+d x)\right )}{a^2 d (m+n+2) \sqrt {\sin ^2(c+d x)}}-\frac {(A (m+n+2)+C (m+n+1)) \sin (c+d x) (a \cos (c+d x))^{m+1} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+1);\frac {1}{2} (m+n+3);\cos ^2(c+d x)\right )}{a d (m+n+1) (m+n+2) \sqrt {\sin ^2(c+d x)}}+\frac {C \sin (c+d x) (a \cos (c+d x))^{m+1} (b \cos (c+d x))^n}{a d (m+n+2)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.23, antiderivative size = 227, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {20, 3023, 2748, 2643} \[ -\frac {B \sin (c+d x) (a \cos (c+d x))^{m+2} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+2);\frac {1}{2} (m+n+4);\cos ^2(c+d x)\right )}{a^2 d (m+n+2) \sqrt {\sin ^2(c+d x)}}-\frac {(A (m+n+2)+C (m+n+1)) \sin (c+d x) (a \cos (c+d x))^{m+1} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+1);\frac {1}{2} (m+n+3);\cos ^2(c+d x)\right )}{a d (m+n+1) (m+n+2) \sqrt {\sin ^2(c+d x)}}+\frac {C \sin (c+d x) (a \cos (c+d x))^{m+1} (b \cos (c+d x))^n}{a d (m+n+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 20
Rule 2643
Rule 2748
Rule 3023
Rubi steps
\begin {align*} \int (a \cos (c+d x))^m (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx &=\left ((a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{m+n} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\\ &=\frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}+\frac {\left ((a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{m+n} (a (C (1+m+n)+A (2+m+n))+a B (2+m+n) \cos (c+d x)) \, dx}{a (2+m+n)}\\ &=\frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}+\frac {\left (B (a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{1+m+n} \, dx}{a}+\frac {\left ((C (1+m+n)+A (2+m+n)) (a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{m+n} \, dx}{2+m+n}\\ &=\frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}-\frac {(C (1+m+n)+A (2+m+n)) (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1+m+n);\frac {1}{2} (3+m+n);\cos ^2(c+d x)\right ) \sin (c+d x)}{a d (1+m+n) (2+m+n) \sqrt {\sin ^2(c+d x)}}-\frac {B (a \cos (c+d x))^{2+m} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (2+m+n);\frac {1}{2} (4+m+n);\cos ^2(c+d x)\right ) \sin (c+d x)}{a^2 d (2+m+n) \sqrt {\sin ^2(c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.26, size = 161, normalized size = 0.71 \[ -\frac {\sin (c+d x) \cos (c+d x) (a \cos (c+d x))^m (b \cos (c+d x))^n \left ((A (m+n+2)+C (m+n+1)) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+1);\frac {1}{2} (m+n+3);\cos ^2(c+d x)\right )+(m+n+1) \left (B \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+2);\frac {1}{2} (m+n+4);\cos ^2(c+d x)\right )-C \sqrt {\sin ^2(c+d x)}\right )\right )}{d (m+n+1) (m+n+2) \sqrt {\sin ^2(c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.46, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (a \cos \left (d x + c\right )\right )^{m} \left (b \cos \left (d x + c\right )\right )^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (a \cos \left (d x + c\right )\right )^{m} \left (b \cos \left (d x + c\right )\right )^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 2.50, size = 0, normalized size = 0.00 \[ \int \left (a \cos \left (d x +c \right )\right )^{m} \left (b \cos \left (d x +c \right )\right )^{n} \left (A +B \cos \left (d x +c \right )+C \left (\cos ^{2}\left (d x +c \right )\right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (a \cos \left (d x + c\right )\right )^{m} \left (b \cos \left (d x + c\right )\right )^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (a\,\cos \left (c+d\,x\right )\right )}^m\,{\left (b\,\cos \left (c+d\,x\right )\right )}^n\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \cos {\left (c + d x \right )}\right )^{m} \left (b \cos {\left (c + d x \right )}\right )^{n} \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________